﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MarvellousWorks.PracticalPatternNet8.Concept.Operator;

public class ErrorEntity
{
    private List<string> messages = new();
    private List<int> codes = new();

    public static ErrorEntity operator +(ErrorEntity entity, string message)
    {
        entity.messages.Add(message);
        return entity;
    }

    public static ErrorEntity operator +(ErrorEntity entity, int code)
    {
        entity.codes.Add(code);
        return entity;
    }

    public List<string> Messages { get { return messages; } }
    public List<int> Codes { get { return codes; } }
}
